package battle;

import org.junit.After;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class GuanYu {

    private String name="关羽";
    @Autowired
    @Qualifier("snakeLance")
    private Weapon weapon;
    @Autowired
    @Qualifier("diLu")
    private Mount mount;

    public void fight(){
        System.out.println(name+"骑着"+mount+"使用"+
                                        weapon+"战斗");
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Weapon getWeapon() {
        return weapon;
    }

    public void setWeapon(Weapon weapon) {
        this.weapon = weapon;
    }

    public Mount getMount() {
        return mount;
    }

    public void setMount(Mount mount) {
        this.mount = mount;
    }
}
